package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.EvaluationLogFormalDao;
import cn.topevery.garden.entity.po.EvaluationLogFormal;
import cn.topevery.garden.entity.query.EvaluationLogFormalQuery;
import cn.topevery.garden.entity.vo.EvaluationLogFormalVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 检查考评上报记录表
 *
 * @author code-generate
 * @date 2022-01-05
 */
@Service
public class EvaluationLogFormalLogic extends BaseLogic<EvaluationLogFormal> {
    @Autowired
    EvaluationLogFormalDao evaluationLogFormalDao;

    @Override
    public BaseEntityDao<EvaluationLogFormal, Integer> getDao() {
        return evaluationLogFormalDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<EvaluationLogFormalVO> listPage(EvaluationLogFormalQuery query) {
        return evaluationLogFormalDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        evaluationLogFormalDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param evaluationLogFormal 实体
     */
    public void saveOrUpdate(String userId, EvaluationLogFormal evaluationLogFormal){
        evaluationLogFormalDao.saveOrUpdate(userId,evaluationLogFormal);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public EvaluationLogFormal getEntityByColumn(String key, String value) {
        return evaluationLogFormalDao.getEntityByColumn(key, value);
    }

    public void statisticsLogAdd(Map<String, Object> map){
        evaluationLogFormalDao.statisticsLogAdd(map);
    }

    public  List<EvaluationLogFormal> getFormalReportList(Map<String, Object> map){
      return  evaluationLogFormalDao.getFormalReportList(map);
    }
}
